package com.atguigu.gulimall.product;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class CreateThread04 {
    // 创建固定2个线程的线程池
    public static ExecutorService executorService = Executors.newFixedThreadPool(2);


    public static void main(String[] args) {
        System.out.println("main start...");
        executorService.execute(new Runnable() {
            @Override
            public void run() {
                System.out.println("当前线程：" + Thread.currentThread().getName());
                int i = 10 / 2;
                System.out.println("运行结果：" + i);
            }
        });
        System.out.println("main end...");
    }
}
